package com.demo.afternoon;

import java.io.File;
import java.io.IOException;

/**
 * @ClassName FileTest
 * @Description TODO
 * @Author tianqinglong
 * @Date 14:31 2022/7/7
 * @Version 1.0
 **/
public class FileTest {
    public static void main(String[] args) throws IOException {
        File a = new File("D:\\tql\\gitstudy\\day04\\src\\com\\demo\\afternoon", "a.txt");
        a.delete();
        a.createNewFile();

        File file = new File("src\\com\\demo\\afternoon\\a.txt");
        System.out.println(file.getName());//a.txt
        System.out.println(file.getPath()); //src\com\demo\afternoon\a.txt
        System.out.println(file.length());//0
        System.out.println(file.getAbsoluteFile());//D:\tql\gitstudy\src\com\demo\afternoon\a.txt
    }
}
